home *** CD-ROM | disk | FTP | other *** search
- /*
-
- test term program
-
- Copyright 1995, ALec Russell
-
- This WORKS with Alec Russell's serial.c / serio.h stuff.
-
- */
-
- #include <stdio.h>
- #include <bios.h>
- #include <io.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <time.h>
- #include <alloc.h>
- #include <dos.h>
- #include <time.h>
- #include <string.h>
-
- #include "serio.h"
-
- /* ---------------------- main() --------------------- September 19,1993 */
- void main(void)
- {
- int a;
- short done;
- serial_232_t serial_data;
-
- /* setup default parms for com port etc... */
- serial_data.comport=1;
- serial_data.irq=0;
- serial_data.baud=BAUD_9600;
- serial_data.bits=8;
- serial_data.parity=PARITY_NONE;
- serial_data.stops=1;
-
- init_232(&serial_data);
-
- done=0;
- while ( !done )
- {
- if ( char_ready_232() )
- {
- a=get_232();
- printf("%c", a);
-
- switch ( a )
- {
- // put more options here
-
- case '\r':
- printf("\n");
- break;
- }
- }
-
- if ( bioskey(1) )
- {
- a=getch();
- if ( a == 0 ) // Function keys / arrow keys require this code
- a=-getch();
-
- printf("%c", a);
- send_232(a);
-
- switch ( a )
- {
- // put more options here
-
- case ESC:
- done=1;
- break;
- }
- }
- }
-
- deinit_232();
- }
- /* ------------------ EOF ------------------------------------------ */
-
-